package cn.tangsihai.hrm.client;

import cn.tangsihai.hrm.domain.Login;
import cn.tangsihai.hrm.dto.LoginAndMealId;
import cn.tangsihai.hrm.util.AjaxResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * 登录信息保存接口
 */
@FeignClient(value = "auth-server", fallbackFactory = LoginMealFallbackFactory.class) // 服务名: 写主方法所在服务的服务名
public interface AuthClient {
    // 保存login、和login_meal表的数据
    @RequestMapping("/login/saveLoginAndMeal")
    AjaxResult saveLoginAndMeal(@RequestBody LoginAndMealId loginAndMealId);

    // 保存login表的数据
    @RequestMapping("/login/saveLogin")
    AjaxResult saveLogin(@RequestBody Login login);
}
